<!--教师端查看周报详情-->
<!DOCTYPE html>
<html class="base_gary_bg_color">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>周报详情</title>
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css">
		<!--<link rel="stylesheet" href="../../css/CFNetPP_Base.css">-->
		<link rel="stylesheet" href="../../css/base.css">
	</head>
	<body class="base_gary_bg_color">
		<div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span>查看周报详情</span>
			<a class="base_right_item base_hide_item" href="#"> </a>
		</div>
		<div class="base_content_div writeReport">
			<div class="ReviewWeekly_div top_54" >
				<ul class="mui-table-view">
					<li class="mui-table-view-cell base_dark_grey" id="timediv_one" style="display: none">
						<div class="cell_left_img_div">
							<img class="cell_img" src="../../image/icon_clock.png" alt="">
						</div>
						<span class="time_span base_title_font" > 应交日期:</span>
						<span class="time_span base_title_font" id="weeklytime"> </span>
					</li>
					<li class="mui-table-view-cell base_dark_grey" id="timediv_two">
						<div class="cell_left_img_div">
							<img class="cell_img" src="../../image/icon_clock.png" alt="">
						</div>
						<span class="time_span base_title_font" > 提交日期:</span>
						<span class="time_span base_title_font" id="time"> </span>
					</li>
				</ul>
			</div>
			<div class="ReviewWeekly_div">
				<div class="feeling">
					<p class="title">
						本周总结
					</p>
					<div class="feeling-text">
						<p id="summary" style=" word-break: break-all"></p>
					</div>
				</div>
			</div>
			<div class="ReviewWeekly_div">
				<div class="feeling">
					<p class="title">
						下周计划
					</p>
					<div class="feeling-text">
						<p id="weekplan" style=" word-break: break-all"></p>
					</div>
				</div>
			</div>
			<div class="ReviewWeekly_div">
				<div class="feeling">
					<p class="title">
						老师评语
					</p>
					<div class="feeling-text">
						<p id="comment" style=" word-break: break-all" class=""></p>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/mui.min.js"></script>
	<script src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/base64.min.js"></script>
	<script type="text/javascript" src="../../script/copyTool.js"></script>
	<script type="text/javascript">
		var weeklyid = '';
		apiready = function() {
			SendBehaviorTrajectoriesNotifi1('0', '学生端周报列表详情', '091', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
			var pageParam = api.pageParam;
			weeklyid = parseInt(pageParam.weeklyid);
			loadWeeklyData();
			blockAddCopyClickWithIdArr(["summary","weekplan","comment"]);
		};
		//判断当前提交时间和补交时间是否在同一周
		function isSameWeek(weeklytime, time) {
			var day = new Date(time * 1000).getDay();
			//星期几
			var mintime = time - day * 3600 * 24;
			//一周开始时间
			var maxtime = time + (7 - day) * 3600 * 24;
			//一周结束时间
			if (weeklytime >= mintime && weeklytime <= maxtime) {
				return true;
			} else {
				return false;
			}
		}

		//获取周报详情数据
		function loadWeeklyData() {
			var param = {
				weeklyid : weeklyid
			};
			cfnetppPOST(urlLswklist, param, true, function(data, status) {
				if (status == 'success') {
					if (data.status == 1) {
						var dataArr = data.json;
						if (dataArr != null) {
							var weeklytime = parseInt(dataArr.weeklytime);
							var time = parseInt(dataArr.time);
							var weeklyStr = getLocalTime(weeklytime);
							if (isSameWeek(weeklytime, time) == true) {
								$('#time').text(getLocalTime(weeklytime));
								$('#timediv_one').hide();
							} else {
								$('#timediv_one').show();
								$('#time').text(getLocalTime(time));
								$('#weeklytime').text(weeklyStr);
							}
							var summary = dataArr.summary;
							var comment = dataArr.comments;
							$('#summary').text(isString(Base64.decode(summary)));
							$('#weekplan').text(Base64.decode(dataArr.weekplan));
							var spanstate = dataArr.reviewstatus;
							if (spanstate == 1) {
								if (Base64.decode(comment).length != 0) {
									$('#comment').text(Base64.decode(comment));
								} else {
									$('#comment').text('无老师评语');
								}
							} else {
								document.getElementById("comment").style.color = "#D9D9D9";
								$('#comment').text('你处于未审核状态，请耐心等待');
							}
						} else {
							api.toast({
								msg : '获取数据失败',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else {
						api.toast({
							msg : '获取数据失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '网络连接失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		function backClick() {
			//			SendBehaviorTrajectoriesNotifi('1', '学生端周报列表详情', '091');
			SendBehaviorTrajectoriesNotifi1('1', '学生端周报列表详情', '091', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
			api.closeWin();
		}
	</script>
</html>